﻿#region Using directives

using System;
using System.Xml;
using System.Drawing.Design;
using System.ComponentModel;
using MCMLXVII.BackEnd.Services.OrganizationChart.Messages;
using MCMLXVII.BackEnd.Services.OrganizationChart.Interfaces;
using MCMLXVII.Core.Common;
#endregion

namespace MCMLXVII.Tools.OrganizationChart.MembersClasses
{
    public class MemberLoadBalancer: MemberBase , iOrganizationTreeMemberAsGroup
    {
        protected msgMembershipInfo[] _Members;

        public MemberLoadBalancer(): base()
        { 
        
        }

        public override void LoadMemberData(msgOrganizationMemberInfo memberInfo)
        {
            base.LoadMemberData(memberInfo);
            _Members = memberInfo.MemberOf;
        }

        public override msgOrganizationMemberInfo GetMemberData()
        {
            return new msgOrganizationMemberInfo(base._MemberID, base._Description, base._NodeID, base._MemberClass, base._ClassProperties.OuterXml, 0, "", "", "", new msgMembershipInfo(0, 0, ""), _Members, base._UpdateSequence);
        }

        [Browsable(false)]
        public override System.Drawing.Icon GetIcon()
        {
            return Properties.Resources.icoLoadBalancer;
        }


        [LocCategory("Misc"), LocDescription("Members_Description"), LocDisplayName("Members_DisplayName"), Editor(typeof(UserGroupMembershipEditor), typeof(UITypeEditor)), TypeConverter(typeof(CollectionConverter))]
        public msgMembershipInfo[] Members
        {
            get
            {
                return _Members;
            }

            set
            {
                _Members = value;
                base.MarkChanges();
            }
        }
    }
}
